global root "C:\Users\chupilkm\EBRD\OCE - Maxim\War data\Earthquakes replication"

****Table 1 (summary statistics)

foreach var in "gdppc" "export_growth" "import_growth" "csh_i" "csh_g"  "debt_to_GDP"{

clear
use "$root\Data\Working data\earthquake_`var'_dataset.dta"

gen balanced_sample=1 if growth_pre_earthquake_5!=. & growth_pre_earthquake_4!=. & growth_pre_earthquake_3!=. & growth_pre_earthquake_2!=. & growth_pre_earthquake_1!=. & growth_earthquake!=. & growth_post_earthquake_1!=. & growth_post_earthquake_2!=. & growth_post_earthquake_3!=. & growth_post_earthquake_4!=. & growth_post_earthquake_5 != .

keep if balanced_sample==1

sum growth_earthquake, d

}

****Table 2 (all earthquakes that we use for GDP)

clear
use "$root\Data\Working data\earthquake_gdppc_dataset.dta"

gen balanced_sample=1 if growth_pre_earthquake_5!=. & growth_pre_earthquake_4!=. & growth_pre_earthquake_3!=. & growth_pre_earthquake_2!=. & growth_pre_earthquake_1!=. & growth_earthquake!=. & growth_post_earthquake_1!=. & growth_post_earthquake_2!=. & growth_post_earthquake_3!=. & growth_post_earthquake_4!=. & growth_post_earthquake_5 != .

keep if balanced_sample==1